<template>
    <div>
        <h1>字符串工具</h1>
        <div>常用的字符串工具</div>

        <h3>isNull-空判断</h3>
        <div>
            对空数组、空字符串、undefined、null、NaN返回true，其他的返回false，比如0、'0'等判断不为空，所以返回true
        </div>
        <dCode :code="conf.str" />

        <h3>uuid-获取uuid</h3>
        <div class="code">StrUtil.uuid()</div>

        <h3>getId-获取唯一Id</h3>
        <div class="code">StrUtil.getId()</div>

        <h3>isNumber-判断是否是数字</h3>
        <div class="code">StrUtil.isNumber('99')</div>

        <h3>getParam-获取url地址中的参数对象</h3>
        <div>如/list?pageSize=1&pageNum=2，得:{pageSize:1,pageNum:2}</div>
        <div class="code">StrUtil.getParam('/list?pageSize=1&pageNum=2')</div>

        <h3>copyText-复制文本到粘贴板</h3>
        <div class="code">StrUtil.copyText('666')</div>
        
    </div>
</template>
<script setup lang="ts">
import { reactive } from 'vue'

const conf = reactive({
    str: `//使用isNull或者StrUtil.isNull都可以
console.log(isNull('0'));
console.log(StrUtil.isNull(0));
console.log(StrUtil.isNull(NaN));
console.log(StrUtil.isNull([]));
console.log(StrUtil.isNull(null));
console.log(StrUtil.isNull(undefined));`
})
</script>
<style lang="less" scoped></style>
